function getGPS() {
	let options = {
		provider: 'baidu',
		getLocationCallback: (position) => {},
		watchLocationCallback: (position) => {},
	}

	let gps = {
		setOptions: (customOptions) => {
			Object.assign(options, customOptions)
		},

		getCurrentPosition: () => {
			// 使用百度地图地位模块获取位置信息
			plus.geolocation.getCurrentPosition(function(p) {
				if (options.getLocationCallback) {
					options.getLocationCallback(p)
				}
			}, function(e) {
				console.error('获取位置信息发生错误: ' + e.message);
			}, {
				provider: options.provider
			});
		},
		watchPosition: () => {
			return plus.geolocation.watchPosition(function(p) {
				if (options.watchLocationCallback) {
					options.watchLocationCallback(p)
				}
			}, function(e) {
				console.error('获取位置信息发生错误: ' + e.message);
			}, {
				provider: options.provider
			});
		},
		clearWatchPostion(watchId) {
			plus.geolocation.clearWatch(watchId);
		}
	}

	return gps
}